package com.example.springsecurity01.controller;

import com.example.springsecurity01.dto.LoginForm;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yangdc
 * @date 2024/11/22
 */
@RestController
public class IndexController {
    @GetMapping("")
    public ResponseEntity<String> index() {
        return ResponseEntity.ok("index");
    }

    @GetMapping("success")
    public ResponseEntity<String> success() {
        return ResponseEntity.ok("success");
    }

    @RequestMapping("hello")
    public ResponseEntity<String> hello() {
        return ResponseEntity.ok("hello spring security");
    }

//    @PostMapping("doLogin")
//    public ResponseEntity<String> doLogin(LoginForm loginForm) {
//        System.out.println(loginForm);
//        return ResponseEntity.ok("ok");
//    }
}
